package com.cqupt.scanning.system.admin.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cqupt.scanning.system.admin.entity.PatientThree;
import com.cqupt.scanning.system.admin.service.PatientThreeService;
import com.cqupt.scanning.system.utils.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 病人用户（前端展示） 前端控制器
 * </p>
 *
 * @author 宋宝梁
 * @since 2021-07-06
 */
@RestController
@RequestMapping("/admin/organization/patientthree")
public class PatientThreeController {

    private PatientThreeService patientThreeService;

    @Autowired
    public PatientThreeController(PatientThreeService patientThreeService) {
        this.patientThreeService = patientThreeService;
    }

    @GetMapping("/getAll")
    @PreAuthorize("hasAuthority('3Dscanning.getAll')")
    public R getAll(@RequestParam(value = "name",required = false) String name,
                    @RequestParam(value = "sex",required = false) String sex,
                    @RequestParam(value = "devNum",required = false) String devNum,
                    @RequestParam(value = "orgName",required = false) String orgName,
                    @RequestParam(value = "phone",required = false) String phone,
                    @RequestParam(value = "doctor",required = false) String doctor,
                    @RequestParam(value = "pageNum", defaultValue = "1") Integer current,
                    @RequestParam(value = "pageSize", defaultValue = "10") Integer size) {
        Page<PatientThree> page = new Page<>(current, size);
        return patientThreeService.getAll(page, name,sex,phone,doctor, devNum,orgName);
    }

}

